interfaces/apparmor: mock presence of overlayfs root
authorZygmunt Krynicki <me@zygoon.pl>
Mon, 21 Jan 2019 17:55:12 +0000 (18:55 +0100)
committerMichael Hudson-Doyle <mwhudson@debian.org>
Thu, 24 Jan 2019 03:11:17 +0000 (03:11 +0000)
commit973a13572df41c6c4899fb275b53f74a4299cead
tree1112c254ee6f6154c42af4b08aefa60c2888401a
parentd81a77142789224bd094006d721250ad4fb7475a
interfaces/apparmor: mock presence of overlayfs root

During the release of the snapd 2.37 we noticed that the Debian
builds performed in sbuild are failing on several unit tests. The same
source package would build file in pbuilder.

Investigation uncovered that sbuild is using overlayfs root internally.
This is picked up by the apparmor overlayfs detector and causes snapd to
generate an additional configuration file for snap-confine.

For reference, the offending entry from /proc/self/mountinfo:

228 23 0:40 / / rw,relatime shared:119 - overlay sid-amd64-sbuild rw,lowerdir=/var/lib/schroot/union/underlay/sid-amd64-sbuild-85592074-da40-4faa-8b25-a354b207cdf2,upperdir=/var/lib/schroot/union/overlay/sid-amd64-sbuild-85592074-da40-4faa-8b25-a354b207cdf2/upper,workdir=/var/lib/schroot/union/overlay/sid-amd64-sbuild-85592074-da40-4faa-8b25-a354b207cdf2/work

The extra generated file was upsetting tests that looked at
/var/lib/snapd/apparmor/snap-confine.

Signed-off-by: Zygmunt Krynicki <me@zygoon.pl>
Gbp-Pq: Name 0009-interfaces-apparmor-mock-presence-of-overlayfs-root.patch
interfaces/apparmor/backend_test.go